#ifndef _SHADER_H_
#define _SHADER_H_

#include"Common.h"

#include<thirdparty\glew.h>
#include<thirdparty\glm\glm.hpp>
#include<thirdparty\glm\gtc\type_ptr.hpp>

#include<memory>
#include<string>

namespace Craft{

/*
@brief
*/
class Shader
{
public:
	Shader();

	Shader& use();

	void compile(const GLchar* vertexSource, const GLchar* fragmentSource, const GLchar* geometrySource = nullptr);

	GLuint get_ID()const
	{
		return m_ID;
	}

	void SetInteger( const GLchar *name, const int& value,      GLboolean useShader = false);
	void SetVector3f(const GLchar *name, const glm::vec3 &value, GLboolean useShader = false);
	void SetVector4f(const GLchar *name, const glm::vec4 &value, GLboolean useShader = false);
	void SetMatrix4( const GLchar *name, const glm::mat4 &matrix, GLboolean useShader = false);

private:
	void check_compile_errors(GLuint object, std::string type);

private:

	GLuint m_ID;

};

}

#endif